﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
/// <summary>
///问题：如何简化C#属性
/// 解决方案：使用自动属性
/// </summary>
namespace Ex01
{
    class Product
    {
        //支持字段
        private string _name;

        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }


        public string Name2 { get; set; }

    }
    class Program
    {
        static void Main(string[] args)
        {
            var product = new Product();
        }
    }
}
